package com.briup.sms.web.controller;

import com.briup.sms.entity.Admin;
import com.briup.sms.service.AdminService;
import com.briup.sms.utils.Result;
import com.briup.sms.utils.SMSException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
@Api(tags = "管理员模块")
public class AdminController {
    @Autowired
    private AdminService service;

    @PostMapping("/login")
    @ApiOperation("管理员登录")
    public Result login(@RequestBody Admin admin){
            String token = service.login(admin);
            return  Result.success(token);
    }
}
